/*
 * @name: **列表
 * @content:
 * @Author: joyce
 * @Date: 2020-09-09 10:44:39
 */
let mongoose = require("mongoose");

module.exports = (app) => {
  let mongodbUrl = "mongodb://test1:123qwe@36.111.191.92:27017/test";
  mongoose.connect(
    mongodbUrl,
    {
      useNewUrlParser: true,
      useUnifiedTopology: true,
    },
    (err) => {
      if (err) {
        console.log("数据库链接失败:", err);
      }
    }
  );

  mongoose.connection.once("open", () => {
    console.log("数据库链接成功");
  });
};
